const { createProxyMiddleware } = require('http-proxy-middleware');

module.exports = app => {
  app.use('/api', createProxyMiddleware({
    target: 'http://localhost:8000',
    pathRewrite: {
      '^/api': ''
    },
    changeOrigin: true
  }))

  app.use('/xx', createProxyMiddleware({
    target: 'http://localhost:5000',
    pathRewrite: {
      '^/xx': ''
    },
    changeOrigin: true
  }))
}